using System;

namespace PIM.Utilities
{
	/// <summary>
	/// Summary description for NTextString.
	/// </summary>
	public class NTextString : IConvertible
	{
		string _internalstr;
		public NTextString(string s)
		{
			//
			// TODO: Add constructor logic here
			//
			_internalstr = s;
		}
		public TypeCode GetTypeCode()
		{
			return TypeCode.Object;
		}
		public byte ToByte(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to Byte");
		}
 
		public char ToChar(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to Char");
		}
 
		public bool ToBoolean(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to Boolean");
		}

		public DateTime ToDateTime(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to DateTime");
		}
 
		public decimal ToDecimal(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to Decimal");
		}
 
		public double ToDouble(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to Double");
		}
 
		public short ToInt16(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToInt16");
		}
 
		public int ToInt32(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToInt32");
		}
 
		public long ToInt64(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToInt64");
		}
 
		public sbyte ToSByte(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToSByte");
		}
 
		public float ToSingle(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToSingle");
		}
 
		public string ToString(IFormatProvider provider)
		{
			return _internalstr;
		}
		
		public override string ToString()
		{
			return _internalstr;
		}

		public ushort ToUInt16(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToUInt16");
		}
 
		public uint ToUInt32(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToUInt32");
		}
 
		public ulong ToUInt64(IFormatProvider provider)
		{
			throw new InvalidCastException("Cannot cast NTextString to ToUInt64");
		}

		public object ToType(Type conversionType, IFormatProvider provider)
		{
			return Convert.ChangeType(_internalstr, conversionType);
		}
 
	}
}
